<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<%@ include file="../../include/pGrid.jsp" %>
<script src="/plug-in/layui/layui.js"></script>
<title>立项编号自动生成</title>
<script>
	var timeNo = null;
	$(function(){
		var util = null;
		layui.use('util', function(){
		  util = layui.util;
		  timeNo = util.toDateString(new Date(), 'yyyyMMddmmss').substring(2);
		});
		
		var gridParam = {
			singleSelect:  true ,
			queryParams: {
				pCode: 'B5',
				pCode_searchType: "eq"
			},
			url : '/console/com.fs.base.pojo.Dictionary/list',
			columns : [[ 
			    {field: 'dicName', title: '区域名称', width: 100}
			    ,{field: 'dicValue', title: '区域简码', width: 120}
			    ,{field: 'pNo', title: '随机编号', width: 150,formatter:function(value,row,index){
			    	return row.dicValue + timeNo;
			    }}
			]]
		};
		p.dataGrid = $(p.dataGrid).datagrid( $.extend({}, p.dataGridParam,gridParam));
		/*事件响应*/
		$("#buttons .easyui-linkbutton").on("click", function() {
			var motion_code = $(this).attr("motion_code");p.btnOneClick($(this));
			switch (motion_code) {
				case "05":
					timeNo = util.toDateString(new Date(), 'yyyyMMddmmss').substring(2);
					p.gridQuery();
					break;
				default:
					break;
				}
		});
	});
	/*窗口确认回调方法*/
	function choose(){
		var choose = [];
		var result = p.dataGrid.datagrid('getSelections');
		if(result.length>0){
			choose.push({pNo:result[0].dicValue + timeNo });
		}
		return choose;
	}
</script>
</head>
<body class="easyui-layout">
	<!-- 但行高度33px，多行时 33乘以行数  -->
	<div data-options="region:'north',split:false,border:false" style="height:33px;">
		<div class="easyui-panel" data-options="fit:true,border:false">
			<!-- 查询条件表单，根据配置进行替换  -->
			<form id="queryForm" >
			 <input type="hidden" name="className" value="com.fs.jzzn.pojo.Project" />
			 <div style="margin-top:5px;margin-left:10px;float:left;">
			  	<input class="easyui-textbox" name="dicName" style="width:240px;" data-options="label:'区域名称:',required:false" />
				<input type="hidden" name="dicName_searchType" value="like" />
			 </div>
			 <div id="buttons" style="margin-top:5px;margin-left:10px;float:left;">
			 	<a href="#" class="easyui-linkbutton" iconCls="icon-search" motion_code="05" plain="true">查询/刷新</a>
			 </div>
			</form>
		</div>
	</div>  

	<!-- 表格 -->
	<div region="center" border="false">
		<table id="dataGrid"></table>
	</div>
</body>
</html>